package cs3343.project.family;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class Dice2 {
	
	private JLabel[] diceImg = new JLabel[7]; 
	
	public Dice2() {
		for (int i = 0; i < 7; i++) {
			diceImg[i] = new JLabel(new ImageIcon(ConfigManager.IMAGE_PATH + "dice_" + Integer.toString(i) + ".gif"));
			diceImg[i].setBounds(300, 250, 100, 100);
			diceImg[i].setVisible(false);
		}
	}
	
	public int rollDice(int high, int low) {
		return (int) (Math.random() * (high - low) + low + 1);
	}
	
	public void showDiceImage(int diceNum) {
		for (int i = 0; i < 7; i++)
			diceImg[i].setVisible(false);		
		diceImg[diceNum].setVisible(true);
	}
	
	public void hideDiceImage(int diceNum) {
		diceImg[diceNum].setVisible(false);
	}

	public JLabel[] getDiceImages() {
		return diceImg;
	}
	
	public JLabel getDiceImage(int diceNum) {
		return diceImg[diceNum];
	}

	public void setDiceImages(JLabel[] diceImg) {
		this.diceImg = diceImg;
	}
}
